<?php
/* 
 * Establish environment within which the web app and daemon scripts will
 * operate.
 *
 * php.ini modifications:
 *
 * CGI
 * error_log = /var/log/pepandlove.log
 *
 * CLI
 * include_path = [existing]:/var/www/pepandlove.org
 * error_log = /var/log/pepandlove.log
 */

require_once('data_access.php');

function init_environment() {
    global $_CONFIG;

    // load config file
    if (!$_CONFIG = (object)parse_ini_file('./conf/config')) {
        throw new Exception('Failed to load config file');
    }

    // assume all handlers/daemons require cassandra connectivity
    db_init();
}

?>
